package com.newtouch.avmarketing.mgr.modules.avmarkrting.repo;

import com.newtouch.avmarketing.mgr.modules.avmarkrting.entity.SpeechRule;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface SpeechRuleRepo extends JpaRepository<SpeechRule,Long> {
    /**
     * 通过步骤序号删除双录步骤
     * @param stepId
     * @return
     */
    @Query(value = "update speech_rule set is_deleted ='1' " +
            "where is_deleted = '0' and step_id = ?1",nativeQuery = true)
    @Modifying
    int deleteSpeechRuleByStepId(Long stepId);

}
